import { createApp } from 'vue'
import { createPinia } from 'pinia'
import App from './App.vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElIconModules from '@element-plus/icons'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
import router from '@/router'
import { ElSubMenu } from "element-plus";
import Avue from '@smallwei/avue';
import '@smallwei/avue/lib/index.css';
import '@/assets/css/common.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
const app = createApp(App)
const pinia = createPinia()
// 全局导入plus图标
for (const iconName in ElIconModules) {
	if (Reflect.has(ElIconModules, iconName)) {
	  const item = ElIconModules[iconName]
	  app.component(iconName, item)
	}
  }
app.config.globalProperties.$icons = []
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.config.globalProperties.$icons.push(key)
    app.component(key, component)
}

app.use(ElementPlus, { size: 'small', zIndex: 800 });  
pinia.use(piniaPluginPersistedstate)
app.use(pinia)
app.use(ElSubMenu)
app.use(router)
app.mount('#app')
app.use(Avue);